<!DOCTYPE html >
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.opener</title>
</head>

<body>
<input type="button" onClick="openweb()" value="开始">

<div id="msg"></div>
</body>
</html>
<script>
window.addEventListener('message',function(e)
	{
		console.log(e.origin,e.data);
		document.getElementById("msg").innerHTML=document.getElementById("msg").innerHTML+"<br>信息来源："+e.origin+"<br>"+e.data
	}
)

function openweb(){
		setTimeout(
			function()
			{
				window.open('child.html','child')
			}
		,1000)
}

</script>